Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for https://github.com/Brewtarget/brewtarget/issues/719 (Reset values of Specific Heat) #721

Merged
merged 1 commit into from
Feb 25, 2023

Conversation

matty0ung
Copy link
Contributor

@matty0ung matty0ung commented Feb 18, 2023

This is the "short term" fix, but with some new code that will be part of the long-term fix sitting ready in the background.

Main changes are:

  • Changed toSI() to toCanonical() and fromSI() to fromCanonical(). Most of our canonical forms are SI or some similar metric system, but, strictly speaking, we don't measure time duration, color, diastatic power etc in SI units
  • Implemented Localization::getLocale() and changed calls to QLocale() to call Localization::getLocale() instead. This makes it easy to override locale in the settings file for testing.
  • Added new BtFieldType of NonPhysicalQuantity::Dimensionless for use in numerical fields where the user is not able to specify/choose the units in the input field
  • New BtLineEdit child classes BtDimensionlessEdit is the corollary to NonPhysicalQuantity::Dimensionless. Others, such as BtViscosityEdit, are mostly unused for now but will come into play when new fields are added as part of BeerJSON work
  • New class MassOrVolumeAmt, which will get used in the BeerJSON work (where more things can be measured by either mass or volume)
  • Beefed up Measurement::Amount from a struct to a class so that MassOrVolumeAmt can inherit from it
  • New units in the Measurement namespace for specific heat capacity - not currently used (as sticking with the hard-coding on Equipment for now) but will be in future
  • Some improvements to NamedParameterBundle which will make it easier to have optional fields in future

@matty0ung matty0ung changed the title Fix for https://github.com/Brewtarget/brewtarget/issues/719 Fix for https://github.com/Brewtarget/brewtarget/issues/719 (Reset values of Specific Heat) Feb 25, 2023
@matty0ung matty0ung merged commit 9fb1f14 into Brewtarget:develop Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant